class CreateRateableObjects < ActiveRecord::Migration
  def self.up
    create_table :rateable_objects do |t|
      t.string        :name,            :limit => 50
      t.string        :creator,         :limit => 50
      t.string        :genre,           :limit => 50
      t.string        :rateable_type,   :limit => 50
      t.string        :url,             :limit => 50
      t.string        :suggested_by,    :limit => 50  
      t.float         :average_score,   :default => 0
      t.boolean       :published,       :default => true
      
      t.timestamps
    end
    
    add_index :rateable_objects, :rateable_type
  end

  def self.down
    drop_table :ratings
  end
end
